/**
 * 
 */
package gisc.gov.vn.dev.projectX.workspace;

import com.iver.cit.gvsig.fmap.drivers.DBException;

/**
 * @author HT
 *
 */
public class GiscConnectionBuilder {
	
	private String _driver="PostGIS JDBC Driver";
	private String _port ="5432";
	private String _host="localhost";
	private String _db="";
	private String _user="";
	private String _pass="";
	private String _name="";
	private Boolean _isConnected=true;
	
	public IGiscConnectionManager BuildConnection()
	{
		return new GiscConnectionManager(_driver,_port,_host,_db,_user,_pass,_name,_isConnected);
	}
	
	public GiscConnectionBuilder Driver(String driver)
	{
		this._driver=driver;
		return this;
	}
	
	public GiscConnectionBuilder Port(String port)
	{
		this._port=port;
		return this;
	}
	
	public GiscConnectionBuilder Host(String host)
	{
		this._host=host;
		return this;
	}
	
	public GiscConnectionBuilder Db(String database)
	{
		this._db=database;
		return this;
	}
	
	public GiscConnectionBuilder User(String user)
	{
		this._user=user;
		return this;
	}
	
	public GiscConnectionBuilder Pass(String pass)
	{
		this._pass=pass;
		return this;
	}
	
	public GiscConnectionBuilder Name(String ConnectionName)
	{
		this._name=ConnectionName;
		return this;
	}
	
	public GiscConnectionBuilder IsConnected(Boolean isConnected)
	{
		this._isConnected=isConnected;
		return this;
	}
}
